package hai.com.android_test.utils;

import okhttp3.OkHttpClient;

/**
 * Created by 黄海 on 2017/1/19.
 */
@Deprecated
public final class OkHttpUtils {
    private static OkHttpClient okHttpClient;

    public static void initClient(OkHttpClient client) {
        if (okHttpClient == null) {
            synchronized (OkHttpUtils.class) {
                if (okHttpClient == null) {
                    okHttpClient = client;
                }
            }
        }
    }

    public static OkHttpClient getOkHttpClient() {
        if (okHttpClient == null)
            throw new NullPointerException("okHttpClient is null,please call initClient first");
        return okHttpClient;
    }
}
